package atag.runtime.ln.estimation.mst;

import java.util.LinkedList;
import java.util.List;

//Represents a vertex in the graph.
public class Vertex {
	public String name; // Vertex name

	public List adj; // Adjacent vertices

	public double dist; // Cost

	public Vertex prev; // Previous vertex on shortest path

	public int scratch;// Extra variable used in algorithm

	public Vertex(String nm) {
		name = nm;
		adj = new LinkedList();
		reset();
	}

	public void reset() {
		dist = Graph.INFINITY;
		prev = null;
		pos = null;
		scratch = 0;
	}
	
	public String getPredecessorName(){
		return prev.name;
	}

	public PriorityQueue.Position pos; // Used for dijkstra2 (Chapter 23)
}
